# -*- coding: utf-8 -*-


import hashlib

# md5 加密
m = hashlib.md5()
m.update('helloaaaaaaaa'.encode('utf-8'))
print(m.hexdigest())
# 5d41402abc4b2a76b9719d911017c592

# sha后面的数字越大加密的算法越复杂
m1 = hashlib.sha256()
m1.update('helloaaaaaaaaaaaaa'.encode('utf-8'))
print(m1.hexdigest())
# f683dd28f66cd8b5042b66b39c192e93485d98a80f7ae8e04924b378b96ff4ea

m2 = hashlib.sha512()
m2.update('helloaaaaaaaaaaaaaaaaa'.encode('utf-8'))
print(m2.hexdigest())
# 8a1f959cff044d72d15c117266c298d14c0cb6602dad5103dc7dcc4feec13f23040f888495c452264c1b5ac90e4325f8829f2783cf50efe6ad9ab6f465d9af6b